import request from '@/utils/request';

export function listPost(data, query) {
  return request({
    url: '/web/base/system/post/page',
    method: 'post',
    data: data,
    params: query,
  });
}

// 查询岗位详细
export function getPost(postId) {
  return request({
    url: '/web/base/system/post/info/' + postId,
    method: 'get',
  });
}

// 新增岗位
export function addPost(data) {
  return request({
    url: '/web/base/system/post/add',
    method: 'post',
    data: data,
  });
}

// 修改岗位
export function updatePost(data) {
  return request({
    url: '/web/base/system/post/edit',
    method: 'post',
    data: data,
  });
}

// 删除岗位
export function delPost(postId) {
  return request({
    url: '/web/base/system/post/delete/' + postId,
    method: 'post',
  });
}

// 导出
export function exportPost(data, params) {
  return request({
    url: '/web/base/system/post/export',
    method: 'post',
    data,
    params,
    responseType: 'blob',
    filename: `post_${new Date().getTime()}.xlsx`,
  });
}
